Recovering from a defective boot image

ABSTRACT

Methods, apparatus and computer program products implement embodiments of the present invention that include detecting, by a first computer having a first memory, a software stack in a second memory of a second computer coupled to the first computer via a network. The software stack is copied from the second memory to the first memory, and the copied software stack is executed by the first computer.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of U.S. patent application Ser. No.13/829,906, filed on Mar. 14, 2013, and is related to U.S. patentapplication Ser. Nos. 13/829,612, 13/830,019, 13/830,081, and13/830,153, each filed Mar. 14, 2013, and which are incorporated hereinby reference.

FIELD OF THE INVENTION

The present invention relates generally to computer systems, andspecifically to recovering from a defective boot image.

BACKGROUND

Operating systems manage the way software applications utilize thehardware of computer systems, such as storage controllers. A fundamentalcomponent of operating systems is the operating system kernel (alsoreferred to herein as a “kernel”), which provides secure computer systemhardware access to software applications executing on the computersystem. Since accessing the hardware can be complex, kernels mayimplement a set of hardware abstractions to provide a clean and uniforminterface to the underlying hardware. The abstractions provided by thekernel provide software developers easier access to the hardware whenwriting software applications.

Two common techniques for rebooting (i.e. restarting) an operatingsystem are a “cold boot” and a “warm boot”. During a cold boot, power toa computer system's volatile memory is cycled (i.e., turned off and thenturned on), and the operating system is rebooted. Since power is cut offto the memory, any contents (i.e., software applications and data)stored in the memory prior to the cold boot are lost. During a warmboot, the operating system reboots while power is still applied to thevolatile memory, thereby enabling the computer to skip some hardwareinitializations and resets. Additionally, during a warm boot the memorymay be reset.

In addition to a warm boot and a cold boot, the Linux operating systemoffers a method of rapidly booting a new operating system kernel via thekexec function. The kexec function first loads a new kernel into memoryand then immediately starts executing the new kernel. Using kexec toboot a new kernel is referred to a “hot” boot/reboot, since thecomputer's memory is not reset during the boot.

The description above is presented as a general overview of related artin this field and should not be construed as an admission that any ofthe information it contains constitutes prior art against the presentpatent application.

SUMMARY

There is provided, in accordance with an embodiment of the presentinvention a method, including detecting, by a first computer having afirst memory, a software stack in a second memory of a second computercoupled to the first computer via a network, copying the software stackfrom the second memory to the first memory, and executing, by the firstcomputer, the copied software stack.

There is also provided, in accordance with an embodiment of the presentinvention a storage system, including a first memory, and a processorcoupled to the first memory, and configured to detect a software stackin a second memory coupled to the first processor via a network, to copythe software stack from the second memory to the first memory, and toexecute the copied software stack.

There is further provided, in accordance with an embodiment of thepresent invention a computer program product, the computer programproduct including a non-transitory computer readable storage mediumhaving computer readable program code embodied therewith, the computerreadable program code including computer readable program code executingon a first computer having a first memory and configured to detect asoftware stack in a second memory of a second computer coupled to thefirst computer via a network, computer readable program code configuredto copy the software stack from the second memory to the first memory,and computer readable program code configured to execute, by the firstcomputer, the copied software stack.

BRIEF DESCRIPTION OF THE DRAWINGS

The disclosure is herein described, by way of example only, withreference to the accompanying drawings, wherein:

FIG. 1 is a block diagram that schematically illustrates a storagesystem, in accordance with an embodiment of the present invention;

FIG. 2 is a block diagram of a module of the storage system configuredto recover from a defective boot image, in accordance with an embodimentof the present invention; and

FIG. 3 is a flow diagram that schematically illustrates a method ofrecovering from the defective boot image, in accordance with anembodiment of the present invention.

DETAILED DESCRIPTION OF EMBODIMENTS

In computing, a boot comprises an initial set of operations that acomputer performs when electrical power is switched on (also referred toas power cycling). During a boot, a computer may load softwarecomponents such as an operating system kernel, services andapplications. The software components that are loaded during a boot aretypically stored in a system startup configuration file. For example,during a boot, a computer configured as a storage system may load aLinux operating system kernel, a network TCP/IP service and a storageapplication configured to process input/output (I/O) requests receivedfrom one or more host computers.

Software components that are loaded during a boot can be stored on aboot device as a boot image. When a computer system boots, the bootimage is retrieved and stored in memory as a software stack. In otherwords, a loaded software stack may comprise an in-memory representationof a corresponding boot image on a boot device.

In a computer network coupling a first computer to a second computer,there may be instances when power is cycled to the first computer, andthe first computer detects a defective boot image (i.e., an error in theboot image) while attempting to boot. For example, the computer mayidentify an invalid signature (i.e., a checksum) for regions storing theboot image. Embodiments of the present invention provide methods andsystems for the first computer to recover from the defective boot image.In some embodiments, upon detecting a defective boot image and detectingthe second computer executing a software stack, the first computer canretrieve the software stack from the second computer's memory and startexecuting the retrieved software stack.

While the embodiments described herein relate generally to a storagesystem such as clustered storage controller, it will be understood thatembodiments of the present invention may also be used for other types ofnetworked computer systems.

FIG. 1 is a block diagram that schematically illustrates a dataprocessing storage subsystem 20, in accordance with an embodiment of theinvention. The particular subsystem (also referred to herein as astorage system) shown in FIG. 1 is presented to facilitate anexplanation of the invention.

However, as the skilled artisan will appreciate, the invention can bepracticed using other computing environments, such as other storagesubsystems with diverse architectures and capabilities.

Storage subsystem 20 receives, from one or more host computers 22,input/output (I/O) requests, which are commands to read or write data atlogical addresses on logical volumes. Any number of host computers 22are coupled to storage subsystem 20 by any means known in the art, forexample, using a network. Herein, by way of example, host computers 22and storage subsystem 20 are assumed to be coupled by a Storage AreaNetwork (SAN) 26 incorporating data connections 24 and Host Bus Adapters(HBAs) 28. The logical addresses specify a range of data blocks within alogical volume, each block herein being assumed by way of example tocontain 512 bytes. For example, a 10 KB data record used in a dataprocessing application on a given host computer 22 would require 20blocks, which the given host computer might specify as being stored at alogical address comprising blocks 1,000 through 1,019 of a logicalvolume. Storage subsystem 20 may operate in, or as, a SAN system.

Storage subsystem 20 comprises a clustered storage controller 34 coupledbetween SAN 26 and a private network 46 using data connections 30 and44, respectively, and incorporating adapters 32 and 42, againrespectively. In some configurations, adapters 32 and 42 may comprisehost SAN adapters (HSAs). Clustered storage controller 34 implementsclusters of storage modules 36, each of which includes an interface 38(in communication between adapters 32 and 42), and a cache 40. Eachstorage module 36 is responsible for a number of storage devices 50 byway of a data connection 48 as shown.

As described previously, each storage module 36 further comprises agiven cache 40. However, it will be appreciated that the number ofcaches 40 used in storage subsystem 20 and in conjunction with clusteredstorage controller 34 may be any convenient number. While all caches 40in storage subsystem 20 may operate in substantially the same manner andcomprise substantially similar elements, this is not a requirement. Eachof the caches 40 may be approximately equal in size and is assumed to becoupled, by way of example, in a one-to-one correspondence with a set ofphysical storage devices 50, which may comprise disks. In oneembodiment, physical storage devices may comprise such disks. Thoseskilled in the art will be able to adapt the description herein tocaches of different sizes.

Each set of storage devices 50 comprises multiple slow and/or fastaccess time mass storage devices, herein below assumed to be multiplehard disks. FIG. 1 shows caches 40 coupled to respective sets of storagedevices 50. In some configurations, the sets of storage devices 50comprise one or more hard disks, which can have different performancecharacteristics. In response to an I/O command, a given cache 40, by wayof example, may read or write data at addressable physical locations ofa given storage device 50. In the embodiment shown in FIG. 1, caches 40are able to exercise certain control functions over storage devices 50.These control functions may alternatively be realized by hardwaredevices such as disk controllers (not shown), which are linked to caches40.

Each storage module 36 is operative to monitor its state, including thestates of associated caches 40, and to transmit configurationinformation to other components of storage subsystem 20 for example,configuration changes that result in blocking intervals, or limit therate at which I/O requests for the sets of physical storage areaccepted.

Routing of commands and data from HBAs 28 to clustered storagecontroller 34 and to each cache 40 may be performed over a networkand/or a switch. Herein, by way of example, HBAs 28 may be coupled tostorage modules 36 by at least one switch (not shown) of SAN 26, whichcan be of any known type having a digital cross-connect function.Additionally or alternatively, HBAs 28 may be coupled to storage modules36.

In some embodiments, data having contiguous logical addresses can bedistributed among modules 36, and within the storage devices in each ofthe modules. Alternatively, the data can be distributed using otheralgorithms, e.g., byte or block interleaving. In general, this increasesbandwidth, for instance, by allowing a volume in a SAN or a file innetwork attached storage to be read from or written to more than onegiven storage device 50 at a time. However, this technique requirescoordination among the various storage devices, and in practice mayrequire complex provisions for any failure of the storage devices, and astrategy for dealing with error checking information, e.g., a techniquefor storing parity information relating to distributed data. Indeed,when logical unit partitions are distributed in sufficiently smallgranularity, data associated with a single logical unit may span all ofthe storage devices 50.

While such hardware is not explicitly shown for purposes of illustrativesimplicity, clustered storage controller 34 may be adapted forimplementation in conjunction with certain hardware, such as a rackmount system, a midplane, and/or a backplane. Indeed, private network 46in one embodiment may be implemented using a backplane. Additionalhardware such as the aforementioned switches, processors, controllers,memory devices, and the like may also be incorporated into clusteredstorage controller 34 and elsewhere within storage subsystem 20, againas the skilled artisan will appreciate. Further, a variety of softwarecomponents, operating systems, firmware, and the like may be integratedinto one storage subsystem 20.

Storage devices 50 may comprise a combination of high capacity hard diskdrives and solid state disk drives. In some embodiments each of storagedevices 50 may comprise a logical storage device. In storage systemsimplementing the Small Computer System Interface (SCSI) protocol, thelogical storage devices may be referred to as logical units, or LUNs.While each LUN can be addressed as a single logical unit, the LUN maycomprise a combination of high capacity hard disk drives and/or solidstate disk drives.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system”.Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Python, Java, Smalltalk, C++ or the like and conventionalprocedural programming languages, such as the “C” programming languageor similar programming languages. The program code may execute entirelyon the user's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/actions specifiedin the flowchart and/or block diagram block or blocks. These computerprogram instructions may also be stored in a computer readable mediumthat can direct a computer, other programmable data processingapparatus, or other devices to function in a particular manner, suchthat the instructions stored in the computer readable medium produce anarticle of manufacture including instructions which implement thefunctions/actions specified in the flowchart and/or block diagram blockor blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/actions specified in the flowchart and/orblock diagram block or blocks.

Remote Boot Image Retrieval

FIG. 2 is a block diagram of modules 36 configured to recover from aboot image 60 that is determined to be defective, in accordance with anembodiment of the present invention. In the description herein, modules36 and their respective components may be differentiated by appending aletter to the identifying numeral, so that modules 36 comprise a firstmodule 36A and a second module 36B. Alternatively a given module 36 mayjust be referred to as module 36.

Module 36 comprises a processor 62, a memory 64, a Basic Input OutputSystem (BIOS) 66 and a boot device 68. In embodiments of the presentinvention, boot device 68 may comprises a storage device such as a harddisk, an optical disk or a solid state drive (SSD). In the configurationshown in FIG. 2, boot device 68A stores a defective boot image 60A andboot device 68B stores a valid (i.e., non-defective) boot image 60B.

BIOS 66 typically comprises a non-volatile memory configured toinitially store power-on self-test (POST) procedures 69. When power iscycled to module 36, processor 62 can execute POST procedures 69 andload a boot loader 70 from boot device 68 to memory 64. Boot loader 70is typically stored on a master boot record of boot device 68. Whenstarted, boot loader 70 can be configured to load components of bootimage 60 to a software stack 72 in memory 64.

Boot image 60 comprises an initial set of components that processor 62executes when power is cycled to module 36. In the example shown in FIG.2, boot image 60 comprises a kernel 74, one or more services 76 and oneor more applications 78. When booting module 36, processor 62 loads bootimage 60 to a software stack 72 in memory 64, and starts executingkernel 74, services 76 and applications 78 from the software stack inmemory 64.

Boot image 60 may also comprise a signature 80 (also called a dataintegrity field or DIF) that may comprise a checksum calculationperformed on regions (i.e., blocks or segments) of boot device 68storing boot image 60. Signature 80 can be used to identify data errorsin boot image 60, particularly (but not exclusively) by boot loader 70.

In the embodiments described herein, a checksum calculated by processor62A does not match signature 80A, and a checksum calculated by processor62B matches signature 80B. Therefore, in the example shown in FIG. 2,boot image 60A has an invalid signature 80A, and is thus considered tobe “defective”. In contrast, boot image 60B has a valid signature 80Band is thus considered to be “valid”.

Processor 62 typically comprises a general-purpose computer, which isprogrammed in software to carry out the functions described herein. Thesoftware may be downloaded to module 36 in electronic form, over anetwork, for example, or it may be provided on non-transitory tangiblemedia, such as optical, magnetic or electronic memory media.Alternatively, some or all of the functions of processor 62 may becarried out by dedicated or programmable digital hardware components, orusing a combination of hardware and software elements.

While the embodiments describe herein have software stack comprisingkernel 74, services 76 and applications 78, any organized collectioncomprising any number of components in memory 64 is considered to bewithin the spirit and scope of the present invention. For example, thecollection (e.g., software stack 72) may comprise only kernel 74.

FIG. 3 is a flow diagram that schematically illustrates a method formodule 36A (also referred to herein as a first computer) to recover fromdefective boot image 60A, in accordance with an embodiment of thepresent invention. In an initial step 90, processor 62A executes bootloader 70A in order to retrieve boot image 60A, and detects a problemwith the retrieved boot image. For example (as described supra),processor 62A can calculate a checksum on regions of boot device 68Astoring boot image 60A, and detect that the calculated checksum does notmatch signature 80A.

In a detection step 92, processor 62A detects module 36B (also referredto herein as a second computer) that is coupled to module 36A vianetwork 46 and is executing software stack 72B. In a copy step 94,processor 62A copies components (i.e., kernel 74B, services 76B andapplications 78B) of software stack 72B from memory 64B to softwarestack 72A in memory 64A.

For example, in step 92, processor 62A can issue a broadcast overnetwork 46, requesting a response from the other modules 36 in thestorage controller. Any available modules can reply, using a firstunicast transmission. Upon receiving the unicast transmissions,processor 62A can select module 36B (i.e., in the example shown in FIG.2), via a second unicast transmission. Upon receiving the second unicasttransmission, module 36B (i.e., the selected module can convey), using athird unicast transmission, software stack 64B to module 36A.

In some embodiments, boot loader 70A may be configured to performdetection step 92 and copy step 94. In alternative embodiments, kernel74A, services 76A and applications 78A may be configured to perform thedetection and the copy steps describe supra. For example, signature 80Amay comprise separate signatures for kernel 74A, services 76A andapplications 78A, and processor 62A may detect an error in services 76Aand/or applications 78A. Therefore, processor 62A may successfully bootkernel 74A from boot device 68A, and subsequently copy services 76Band/or applications 78B from module 36B.

In some embodiments, components of software stack 72B can betransferred, via network 46, to memory 64A using remote direct memoryaccess (RDMA), which typically has little or no performance impact onmodules 36A and 36B. When using RDMA, processor 62A can directly accessmemory 64B to retrieve software stack 74B and stored the retrievedsoftware stack to memory 64A.

In a replacement step 96, processor 62 replaces, on boot device 68A, thedefective boot image with a new boot image 60A comprising the componentsof software stack 72A. Typically, replacement step 96 can be performedif the processor attempted to boot the defective boot image using a coldor a warm boot (i.e., loading the boot image from the boot device). Ininstances with the processor boots the defective boot image using a hotboot (e.g., kexec), the processor may skip step 96. Therefore,embodiments described herein can be used to recover from a defectiveboot image that was loaded via a cold boot, a warm boot or a hot boot.

In a boot step 98, processor 62 starts executing (i.e., boots) kernel74A. Finally, in a start step 100, processor 62A starts executingservices 76A and applications 78A, and the method ends.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the Figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

It will be appreciated that the embodiments described above are cited byway of example, and that the present invention is not limited to whathas been particularly shown and described hereinabove. Rather, the scopeof the present invention includes both combinations and subcombinationsof the various features described hereinabove, as well as variations andmodifications thereof which would occur to persons skilled in the artupon reading the foregoing description and which are not disclosed inthe prior art.

1. A method comprising: detecting, by a first computer having a firstmemory, a software stack in a second memory of a second computer coupledto the first computer via a network; copying the software stack from thesecond memory to the first memory; and executing, by the first computer,the copied software stack.
 2. The method according to claim 1, whereinthe software stack comprises one or more components that are selectedfrom a list comprising an operating system kernel, a service, and asoftware application.
 3. The method according to claim 1, and comprisingupon cycling power to the first computer, detecting, prior to copyingthe software stack, an error in a boot image stored on a boot device forthe first computer.
 4. The method according to claim 3, wherein the bootdevice is selected from a list comprising a solid state drive, a harddisk and an optical disk.
 5. The method according to claim 3, andcomprising saving the copied software stack to a boot device coupled tothe first computer.
 6. The method according to claim 3, whereindetecting the error comprises identifying an invalid signature for theboot image.
 7. The method according to claim 1, wherein copying thesoftware stack comprises the first computer accessing, using remotedirect memory access, the second memory, retrieving the software stackfrom the second memory, and storing the retrieved software stack to thefirst memory.